#ifndef __TYPES_H
#define __TYPES_H

using namespace std;

typedef unsigned char byte;
typedef unsigned short word;
typedef unsigned long dword;
typedef unsigned long long qword;

#define SWAP_INT(x,y) (x^=y,y^=x,x^=y)
#define ABS(x) ((x)<0?(-(x)):(x))
#define MIN(x,y) ((x<y)?(x):(y))
#define MAX(x,y) ((x>y)?(x):(y))
#define forever for(;;)

#define RETRY_TIME          30
#define RETRY_TIME_FACT     2
#define RETRY_TIME_MAX      (1024*60)

enum SType {SOCK_CONNECT=0, SOCK_SERVE};
enum SProto {PROTO_TCP=0, PROTO_UDP};

#endif
